<template>
  <div class="app-container">
    <el-form ref="placeCodeForm" v-loading="formLoading" :rules="rules" :model="form" label-position="top">
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="岗位名称" prop="jobTitle" style="width: 400px">
            <el-input v-model="form.jobTitle" :disabled="true"  />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="岗位地址" prop="jobAddress" style="width: 400px">
            <el-input v-model="form.jobAddress" :disabled="true"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="开始工作时间" prop="startTime" style="width: 400px">
            <el-input v-model="form.startTime" :disabled="true"  />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="结束工作时间" prop="endTime" style="width: 400px">
            <el-input v-model="form.endTime" :disabled="true"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="经验要求（年）" prop="expRequireText" style="width: 400px">
            <el-input v-model="form.expRequireText" :disabled="true"  />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="学历要求" prop="minEducationText" style="width: 400px">
            <el-input v-model="form.minEducationText" :disabled="true"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="岗位福利" prop="welfare" style="width: 400px">
            <el-input v-model="form.welfare" :disabled="true"  />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="月薪（元）" prop="salary" style="width: 400px">
            <el-input v-model="salary" :disabled="true"  />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex" :gutter="20">
        <el-col :span="24">
          <el-form-item label="职位要求" prop="jobDescription" >
            <el-input type="textarea" v-model="form.jobDescription" :disabled="true"  :rows="5"/>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import {findPublishListByIdApi,} from "@/api/companyCode";

export default {
  name: 'PlaceCodeDetail',
  data() {
    return {
      time: [],
      form: {
        id: null,
      },
      salary: '',
      rules: {},
      formLoading: false,
    }
  },
  props: ['id', 'closeDialog'],
  methods: {
    findPublishListById() {
      findPublishListByIdApi({id: this.id}).then((res) => {
        this.form = res;
        this.salary = this.form.minSalary+"-"+this.form.maxSalary;
        this.closeDialog(0);
      }).catch(() => {
        this.$message.error('查询失败');
      }).finally(() => {

      })


    },
  },
  mounted() {
    if (this.id) {
      this.findPublishListById();
    }

  },
}
</script>
<style scoped>
/*
*让select撑开
*/
.el-select, .el-cascader {
  display: block;
}
</style>
